package com.hippo.core.utils

import androidx.annotation.StringRes
import com.hippo.core.BaseApplication
import com.hippo.core.event.MessageEvent
import com.hippo.core.event.MessageEventBus
import kotlinx.coroutines.flow.MutableSharedFlow

object UiHandler {

    val uiStartFlow = MutableSharedFlow<String>()



    fun showToast(msg:String?){
        msg?.let { MessageEventBus.post(MessageEvent.Toast(it)) }
    }

    fun showToast(@StringRes id: Int){
        BaseApplication.context?.let {
            val msg = it.resources.getString(id)
            showToast(msg)
        }
    }












}